@import "./common/mixin.scss";
@import "./common/utils.scss";
@import "./common/vars.scss";

@include module(switch) {
  width: 40px;
  height: 20px;
  border-radius: 40px;
  background: $--color-danger;
  position: relative;
  border: solid 1px $--color-danger;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  vertical-align: middle;
  @include when(disabled) {
    cursor: not-allowed;
    background: mix($--color-white, $--color-danger, $--color-disabled-percent);
    border-color: mix(
      $--color-white,
      $--color-danger,
      $--color-disabled-percent
    );

    @include when(checked) {
      background: mix(
        $--color-white,
        $--color-primary,
        $--color-disabled-percent
      );
      border-color: mix(
        $--color-white,
        $--color-primary,
        $--color-disabled-percent
      );
    }
  }
  @include when(checked) {
    background: $--color-primary;
    border-color: $--color-primary;
  }
  @include element(inner) {
    transition: all 0.2s ease;
    width: 18px;
    height: 18px;
    position: absolute;
    top: 0;
    border-radius: 40px;
    background: white;
  }

  @include modifier(small) {
    width: 36px;
    height: 18px;
    .as-switch__inner {
      width: 16px;
      height: 16px;
    }
  }

  @include modifier(mini) {
    width: 34px;
    height: 16px;
    .as-switch__inner {
      width: 14px;
      height: 14px;
    }
  }
}
